package dto;

import systemServer.members.Member;
import systemServer.members.Recomendation;
import systemServer.reproduction.Song;

public class Assembler {
	public static MemberDTO createMemberDTO(Member m) {
		return new MemberDTO(m.getUsername());
	}
	public static MemberPayDTO createMemberPayDTO(Member m) {
		return new MemberPayDTO(m.getUsername(), m.calculate());
	}
	public static RecomendationDTO createRecomendationDTO(Recomendation r) {
		return new RecomendationDTO(Assembler.createSongInfoDTO(r.getSong()), Assembler.createMemberDTO(r.getMemberFrom()), Assembler.createMemberDTO(r.getMemberTo()));
	}
	public static SongDTO createSongDTO(Song s) {
		return new SongDTO(s.getId(), s.getTitle(), s.getArtist(), s.getDuration(), s.getReleaseDate(), s.getPricePerPlay(), s.getLyrics(), s.getSong());
	}
	public static SongInfoDTO createSongInfoDTO(Song s) {
		return new SongInfoDTO(s.getId(), s.getTitle(), s.getArtist());
	}
}
